'
' Environment.vb
' uAPI Public License
' @author Bastie
'
Namespace uapi
    Public Class Environment

        Public Function getValue(ByVal name As String) As String
            Return Environ(name)
        End Function

        Public Function getNames() As String()
            Dim names(-1) As String
            Dim index As Integer = 1
            Dim env As String

            env = Environ(index)
            While (env <> "")
                env = Left(env, InStr(env, "=") - 1)
                ReDim Preserve names(UBound(names) + 1)
                names(index - 1) = env
                index += 1
                env = Environ(index)
            End While
            Return names
        End Function
    End Class
End Namespace